import React, {Component} from 'react';

import {
    View,
    Text,
    StyleSheet
} from 'react-native';
import NavigationBar from "../common/NavigationBar";
import HomePage from '../pages/HomePage'

export default class Welcome extends Component {
    constructor(props) {
        super(props)
        this.state = {
        }
    }

    componentDidMount() {
        this.timer = setTimeout(() => {
            this.props.navigator.resetTo({
                component: HomePage
            })
        }, 1)
    }

    componentWillUnmount() {
        this.timer && clearTimeout(this.timer)
    }

    render() {
        return (
            <View style={styles.container}>
                <View style={styles.welcome}>
                    <Text>欢迎</Text>
                </View>
            </View>
        )
    }
}

const styles = StyleSheet.create({
    container: {
        flex: 1
    },
    welcome  : {
        flex          : 1,
        justifyContent: 'center',
        alignItems    : 'center',
        flexDirection : 'row'
    }
})